package com.yyfax.pay.common.enums;

public enum DataSrcEnum {
    BUSINESS(0,"业务"),
    CONSOLE(1, "后台");
    private Integer value;
    private String name;

    private DataSrcEnum(Integer value, String name) {
        this.value = value;
        this.name = name;
    }

    public Integer getValue() {
        return value;
    }

    public String getName() {
        return name;
    }

    public boolean isValue(Integer value) {
        return getValue().equals(value);
    }

    public static DataSrcEnum from(Integer value) {
        for (DataSrcEnum type : DataSrcEnum.values()) {
            if (type.isValue(value)) {
                return type;
            }
        }

        return null;
    }
}
